<!DOCTYPE html>
<html  lang="zh-CN" >
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="theme-color" content="#fff" id="theme-color">
  <meta name="description" content="无情">
  <link rel="icon" href="/img/hxf233333.png">
  <title>安装MySQL</title>
  
  
  <meta property="og:title" content="安装MySQL">
  
  
  <meta property="og:url" content="https://hxf233333.gitee.io/2021/02/21/%E5%AE%89%E8%A3%85MySQL/index.html">
  
  
  <meta property="og:img" content="/img/hxf233333.png">
  
  
  
  <meta property="og:type" content="article">
  <meta property="og:article:published_time" content="2021-02-21">
  <meta property="og:article:modified_time" content="2021-04-13">
  <meta property="og:article:author" content="hxf233333">
  
  
  <meta property="og:article:tag" content="MySQL">
  
  
  
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
    var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
      }
    };
    setDarkmode();
  </script>
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
  </script>
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  
  <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
  <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
  <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  <link rel="prefetch" href="//cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-svg.js" as="script">
  
  
  
  <link rel="prefetch" href="https://unpkg.com/valine/dist/Valine.min.js" as="script">
  
  
  
  
<link rel="stylesheet" href="/css/main.css">

  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">

  
  
<link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">

  
  
<link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">

  
  
  
  
  
  
  <link href="/js/lib/prism/prism.min.css" rel="stylesheet" data-prism="prism">
  
  
  
<link rel="stylesheet" href="/js/lib/prism/prism-line-numbers.min.css">

  
  
  
<meta name="generator" content="Hexo 5.3.0"><link rel="alternate" href="/atom.xml" title="无情" type="application/atom+xml">
</head>


<body>
  <div class="wrapper">
    
    <nav class="navbar">
  <div class="navbar-logo">
    <span class="navbar-logo-main">
      
      <img class="navbar-logo-img" src="/img/hxf233333.png" alt="logo">
      
      <span class="navbar-logo-dsc">hxf233333</span>
    </span>
  </div>
  <div class="navbar-menu">
    
    <a href="/" class="navbar-menu-item">
    
    首页
    
    </a>
    
    <a href="/archives" class="navbar-menu-item">
    
    归档
    
    </a>
    
    <a href="/tags" class="navbar-menu-item">
    
    标签
    
    </a>
    
    <a href="/categories" class="navbar-menu-item">
    
    分类
    
    </a>
    
    <a href="/about" class="navbar-menu-item">
    
    关于
    
    </a>
    
    <a href="/links" class="navbar-menu-item">
    
    友链
    
    </a>
    
    <a class="navbar-menu-item darknavbar" id="dark"><i class="iconfont icon-weather"></i></a>
    <a class="navbar-menu-item searchnavbar" id="search"><i class="iconfont icon-search" style="font-size: 1.2rem; font-weight: 400;"></i></a>
  </div>
</nav>
    
    <div id="local-search" style="display: none;">
      <input class="navbar-menu-item" id="search-input" placeholder="请输入搜索内容...">
      <div id="search-content"></div>
    </div>
    
    <div class="section-wrap">
      <div class="container">
        <div class="columns">
          <main class="main-column">
<article class="card card-content">
  <header>
    <h1 class="post-title">
      安装MySQL
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2021-02-21T13:56:42.000Z">
      <i class="iconfont icon-calendar" style="margin-right: 2px;"></i>
      <span>2021-02-21</span>
    </time>
    
    <span class="dot"></span>
    
    <a href="/categories/教程/" class="post-meta-link">教程</a>
    
    
    
    <span class="dot"></span>
    <span>750 字</span>
    
  </div>
  
  <div class="post-meta post-show-meta" style="margin-top: -10px;">
    <div style="display: flex; align-items: center;">
      <i class="iconfont icon-biaoqian" style="margin-right: 2px; font-size: 1.15rem;"></i>
      
      
        <a href="/tags/MySQL/" class="post-meta-link">MySQL</a>
      
    </div>
  </div>
  
  </header>
  <div id="section" class="post-content">
    <h1 id="windows安装MySQL"><a href="#windows安装MySQL" class="headerlink" title="windows安装MySQL"></a>windows安装MySQL</h1><p>安装MySQL普遍采用解压缩包的方式，然后通过命令和配置来安装，这里我在window 10上安装并配置MySQL 5.6。</p>
<h2 id="1-下载MySQL压缩包"><a href="#1-下载MySQL压缩包" class="headerlink" title="1.下载MySQL压缩包"></a>1.下载MySQL压缩包</h2><p>所有平台的 MySQL 下载地址为：<a target="_blank" rel="noopener" href="https://downloads.mysql.com/archives/community/">MySQL 下载</a> 。 挑选你需要的 <code>MySQL Community Server</code> 版本及对应的平台。这里我选择<code>mysql-5.6.26-winx64</code>。</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="mysql%E5%AE%89%E8%A3%85%E5%8C%85%E4%B8%8B%E8%BD%BD.png" class="lozad post-image"src="mysql%E5%AE%89%E8%A3%85%E5%8C%85%E4%B8%8B%E8%BD%BD.png"></p>
<h2 id="2-解压并添加环境变量"><a href="#2-解压并添加环境变量" class="headerlink" title="2.解压并添加环境变量"></a>2.解压并添加环境变量</h2><p>解压下载的压缩包，然后把解压后的文件夹迁到想要安装的目录，如：C:\web 下面，可以重命名为 mysql-5.6.26;</p>
<p>然后右击 此电脑 -&gt;属性-&gt;高级系统设置-&gt;环境变量，在系统变量里选择PATH，在其后面添加: mysql bin文件夹的路径。</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F.png" class="lozad post-image"src="%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F.png"></p>
<h2 id="3-创建my-ini配置文件"><a href="#3-创建my-ini配置文件" class="headerlink" title="3.创建my.ini配置文件"></a>3.创建my.ini配置文件</h2><p>在C:\web\mysql-5.6.26路径下创建名为my.ini的配置文件，然后编辑该文件修改或添加配置；配置修改说明如下：</p>
<pre class="line-numbers language-ini" data-language="ini"><code class="language-ini"><span class="token selector">[client]</span>
<span class="token comment"># 设置mysql客户端默认字符集</span>
<span class="token constant">default-character-set</span><span class="token attr-value"><span class="token punctuation">=</span>utf8</span>
 
<span class="token selector">[mysqld]</span>
<span class="token constant">explicit_defaults_for_timestamp</span> <span class="token attr-value"><span class="token punctuation">=</span> true</span>
<span class="token comment"># 设置3306端口</span>
<span class="token constant">port</span> <span class="token attr-value"><span class="token punctuation">=</span> 3306</span>
<span class="token comment"># 设置mysql的安装目录</span>
<span class="token constant">basedir</span><span class="token attr-value"><span class="token punctuation">=</span>C:\web\mysql-5.6.26</span>
<span class="token comment"># 设置 mysql数据库的数据的存放目录，MySQL 8+ 不需要以下配置，系统自己生成即可，否则有可能报错</span>
<span class="token constant">datadir</span><span class="token attr-value"><span class="token punctuation">=</span>C:\web\mysql-5.6.26\data</span>
<span class="token comment"># 允许最大连接数</span>
<span class="token constant">max_connections</span><span class="token attr-value"><span class="token punctuation">=</span>20</span>
<span class="token comment"># 服务端使用的字符集默认为8比特编码的latin1字符集</span>
<span class="token constant">character-set-server</span><span class="token attr-value"><span class="token punctuation">=</span>utf8</span>
<span class="token comment"># 创建新表时将使用的默认存储引擎</span>
<span class="token constant">default-storage-engine</span><span class="token attr-value"><span class="token punctuation">=</span>INNODB</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h2 id="4-安装MySQL"><a href="#4-安装MySQL" class="headerlink" title="4.安装MySQL"></a>4.安装MySQL</h2><p>前面的工作做好后，就可以开始命令行安装了。</p>
<p>首先以管理员身份运行cmd，通过命令<code>cd c:\web\mysql-5.6.26\bin</code>，进入bin目录；</p>
<p>然后输入命令<code>mysqld --initialize-insecure --user=mysql</code>初始化；</p>
<p>最后输入 <code>mysqld instal</code>l 回车开始安装。</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="%E5%AE%89%E8%A3%85%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1.png" class="lozad post-image"src="%E5%AE%89%E8%A3%85%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1.png"></p>
<p>输入 <code>net start mysql</code> 回车，启动mysql服务，</p>
<p>输入 <code>net stop mysql</code> 回车，停止mysql服务。</p>
<h2 id="5-本地连接数据库"><a href="#5-本地连接数据库" class="headerlink" title="5.本地连接数据库"></a>5.本地连接数据库</h2><p>在cmd输入 <code>mysql -u root -p</code> ，回车，出现 Enter password:，由于刚安装，没有设置密码，直接回车 Enter 进入；输入 <code>show databases;</code> 命令查看默认安装数据库。</p>
<p><img  srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="%E6%9C%AC%E5%9C%B0%E8%BF%9E%E6%8E%A5.png" class="lozad post-image"src="%E6%9C%AC%E5%9C%B0%E8%BF%9E%E6%8E%A5.png"></p>
<h2 id="6-设置root密码"><a href="#6-设置root密码" class="headerlink" title="6.设置root密码"></a>6.设置root密码</h2><p>依次通过以下命令修改root用户名密码：</p>
<pre class="line-numbers language-sql" data-language="sql"><code class="language-sql">mysql<span class="token operator">></span><span class="token keyword">use</span> mysql<span class="token punctuation">;</span> 
mysql<span class="token operator">></span><span class="token keyword">update</span> <span class="token keyword">user</span> <span class="token keyword">set</span> password<span class="token operator">=</span>password<span class="token punctuation">(</span><span class="token string">'your password'</span><span class="token punctuation">)</span> <span class="token keyword">where</span> <span class="token keyword">user</span><span class="token operator">=</span><span class="token string">'root'</span><span class="token punctuation">;</span> 
mysql<span class="token operator">></span>flush <span class="token keyword">privileges</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p>输入 <code>quit</code> 命令退出当前登录，用新的密码重新连接 mysql。</p>
<h2 id="7-远程连接数据库"><a href="#7-远程连接数据库" class="headerlink" title="7.远程连接数据库"></a>7.远程连接数据库</h2><p>MySQL默认只能本机登录，如果本机使用，就可以不用设置远程登录，使用 localhost 做为主机地址登录；如果想远程登录，通过以下命令，设置允许远程登录：</p>
<pre class="line-numbers language-sql" data-language="sql"><code class="language-sql">mysql<span class="token operator">></span><span class="token keyword">GRANT</span> <span class="token keyword">ALL</span> <span class="token keyword">PRIVILEGES</span> <span class="token keyword">ON</span> <span class="token operator">*</span><span class="token punctuation">.</span><span class="token operator">*</span> <span class="token keyword">TO</span> <span class="token string">'your username'</span><span class="token variable">@'%'</span> IDENTIFIED <span class="token keyword">BY</span> <span class="token string">'your password'</span> <span class="token keyword">WITH</span> <span class="token keyword">GRANT</span> <span class="token keyword">OPTION</span><span class="token punctuation">;</span><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<blockquote>
<p>your username 和 your password 改成 MySQL数据库的用户和密码</p>
</blockquote>
<p><code>MySQL 默认3306，确保 3306 端口是可用的，在要远程的电脑上安装一个 MySQL管理工具（如sqlyog），通过 Windows 系统的IP、端口， MySQL的用户名、密码远程连接数据库，管理数据库。</code></p>

  </div>
  <div>
  
  <div class="post-note note-warning copyright" style="margin-top: 42px">
    <p><span style="font-weight: bold;">作者：</span><a target="_blank" rel="nofollow noopener noreferrer" href="https://hxf233333.gitee.io/about">hxf233333</a></p>
    <p><span style="font-weight: bold;">文章链接：</span><a target="_blank" rel="nofollow noopener noreferrer" href="https://hxf233333.gitee.io/2021/02/21/%E5%AE%89%E8%A3%85MySQL/">https://hxf233333.gitee.io/2021/02/21/%E5%AE%89%E8%A3%85MySQL/</a></p>
    <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
  </div>
  
  </div>
</article>
<div class="nav">
  
  <div class="nav-item-prev">
    <a href="/2021/02/24/MySQL学习笔记_day1/" class="nav-link">
      <i class="iconfont icon-left nav-prev-icon"></i>
      <div>
        <div class="nav-label">上一篇</div>
        
        <div class="nav-title">MySQL学习笔记_day1 </div>
        
      </div>
    </a>
  </div>
  
  
  <div class="nav-item-next">
    <a href="/2020/12/26/linux基本知识图/" class="nav-link">
      <div>
        <div class="nav-label">下一篇</div>
        
        <div class="nav-title">linux基本知识图 </div>
        
      </div>
      <i class="iconfont icon-right nav-next-icon"></i>
    </a>
  </div>
  
</div>

<div class="card card-content comment-card" style="margin-top: 16px;">
  <div class="comment-card-title">评论</div>
  
  <div id="vcomments"></div>
  
  <script>
    loadScript("https://unpkg.com/valine/dist/Valine.min.js");
    var oldLoadVa = window.onload;
    window.onload = function () {
      oldLoadVa && oldLoadVa();
      new Valine({
        el: '#vcomments',
        appId: 'TILGM6Ga3CyeOjwCwggjbzaD-MdYXbMMI',
        appKey: 's6cTuJch2xdAViWNL3P7uRx2',
        placeholder: 'Just go go',
        path: window.location.pathname,
        avatar: 'mp',
        meta: ["nick","mail","link"],
        pageSize: '10',
        lang: '',
        visitor: 'false',
        highlight: true,
        recordIP: false,
        
        
        
        enableQQ: 'false',
        requiredFields: [],
      });
    };
  </script>

</div>

<div class="card card-content toc-card" id="mobiletoc">
  <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#windows%E5%AE%89%E8%A3%85MySQL"><span class="toc-text">windows安装MySQL</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E4%B8%8B%E8%BD%BDMySQL%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="toc-text">1.下载MySQL压缩包</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E8%A7%A3%E5%8E%8B%E5%B9%B6%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="toc-text">2.解压并添加环境变量</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-%E5%88%9B%E5%BB%BAmy-ini%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-text">3.创建my.ini配置文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-%E5%AE%89%E8%A3%85MySQL"><span class="toc-text">4.安装MySQL</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-%E6%9C%AC%E5%9C%B0%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">5.本地连接数据库</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-%E8%AE%BE%E7%BD%AEroot%E5%AF%86%E7%A0%81"><span class="toc-text">6.设置root密码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#7-%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">7.远程连接数据库</span></a></li></ol></li></ol>
</div></main>
          <aside class="left-column">
            
            <div class="card card-author">
              
<img src="/img/hxf233333.png" class="author-img">

<p class="author-name">hxf233333</p>
<p class="author-description">make a dream</p>
<div class="author-message">
  <a class="author-posts-count" href="/archives">
    <span>15</span>
    <span>文章</span>
  </a>
  <a class="author-categories-count" href="/categories">
    <span>5</span>
    <span>分类</span>
  </a>
  <a class="author-tags-count" href="/tags">
    <span>3</span>
    <span>标签</span>
  </a>
</div>

            </div>
            
            <div class="sticky-tablet">
  
  
  <article class="display-when-two-columns spacer">
    <div class="card card-content toc-card">
      <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#windows%E5%AE%89%E8%A3%85MySQL"><span class="toc-text">windows安装MySQL</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E4%B8%8B%E8%BD%BDMySQL%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="toc-text">1.下载MySQL压缩包</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E8%A7%A3%E5%8E%8B%E5%B9%B6%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="toc-text">2.解压并添加环境变量</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-%E5%88%9B%E5%BB%BAmy-ini%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-text">3.创建my.ini配置文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-%E5%AE%89%E8%A3%85MySQL"><span class="toc-text">4.安装MySQL</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-%E6%9C%AC%E5%9C%B0%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">5.本地连接数据库</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-%E8%AE%BE%E7%BD%AEroot%E5%AF%86%E7%A0%81"><span class="toc-text">6.设置root密码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#7-%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">7.远程连接数据库</span></a></li></ol></li></ol>
    </div>
  </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header"><i class="iconfont icon-fenlei" style="padding-right: 2px;"></i>分类</div>
  <div class="categories-list">
    
      <a href="/categories/学习笔记">
        <div class="categories-list-item">
          学习笔记
          <span class="categories-list-item-badge">10</span>
        </div>
      </a>
    
      <a href="/categories/常用工具">
        <div class="categories-list-item">
          常用工具
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/思维导图">
        <div class="categories-list-item">
          思维导图
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/搭建环境">
        <div class="categories-list-item">
          搭建环境
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/教程">
        <div class="categories-list-item">
          教程
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header"><i class="iconfont icon-biaoqian" style="padding-right: 2px;"></i>热门标签</div>
  <div class="tags-list">
    
    <a href="\tags\MySQL" title="MySQL"><div class="tags-list-item">MySQL</div></a>
    
    <a href="\tags\Linux" title="Linux"><div class="tags-list-item">Linux</div></a>
    
    <a href="\tags\教程" title="教程"><div class="tags-list-item">教程</div></a>
    
  </div>
</div>
  </article>
  
  
</div>
          </aside>
          <aside class="right-column">
            <div class="sticky-widescreen">
  
  
  <article class="card card-content toc-card">
    <div class="toc-header"><i class="iconfont icon-menu" style="padding-right: 2px;"></i>目录</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#windows%E5%AE%89%E8%A3%85MySQL"><span class="toc-text">windows安装MySQL</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-%E4%B8%8B%E8%BD%BDMySQL%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="toc-text">1.下载MySQL压缩包</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-%E8%A7%A3%E5%8E%8B%E5%B9%B6%E6%B7%BB%E5%8A%A0%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="toc-text">2.解压并添加环境变量</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-%E5%88%9B%E5%BB%BAmy-ini%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-text">3.创建my.ini配置文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#4-%E5%AE%89%E8%A3%85MySQL"><span class="toc-text">4.安装MySQL</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-%E6%9C%AC%E5%9C%B0%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">5.本地连接数据库</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#6-%E8%AE%BE%E7%BD%AEroot%E5%AF%86%E7%A0%81"><span class="toc-text">6.设置root密码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#7-%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E6%95%B0%E6%8D%AE%E5%BA%93"><span class="toc-text">7.远程连接数据库</span></a></li></ol></li></ol>
  </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header"><i class="iconfont icon-wenzhang_huaban" style="padding-right: 2px;"></i>最近文章</div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-04-04</div>
        <a href="/2021/04/04/git版本控制/"><div class="recent-posts-item-content">git版本控制</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-03-06</div>
        <a href="/2021/03/06/MySQL学习笔记_day10(完结)/"><div class="recent-posts-item-content">MySQL学习笔记_day10(完结)</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-03-05</div>
        <a href="/2021/03/05/MySQL学习笔记_day9/"><div class="recent-posts-item-content">MySQL学习笔记_day9</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-03-03</div>
        <a href="/2021/03/03/MySQL学习笔记_day8/"><div class="recent-posts-item-content">MySQL学习笔记_day8</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
          </aside>
        </div>
      </div>
    </div>
  </div>
  
  <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>Copyright ©
          
          2020 -
          
          2021
        </span>
        &nbsp;
        <a href="/" class="footer-link">hxf233333 </a>
      </div>
    </div>

    
    
    
    
      <div class="footer-dsc">
        
        本站总访问量<span id="busuanzi_value_site_pv"></span>次
        
        
        <span>&nbsp;|&nbsp;</span>
        
        
        本站总访客数<span id="busuanzi_value_site_uv"></span>次
        
      </div>
      
    
</footer>
  <a role="button" id="scrollbutton" class="basebutton"  aria-label="回到顶部">
  <i class="iconfont icon-arrowleft button-icon"></i>
</a>
<a role="button" id="menubutton" class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a role="button" id="popbutton" class="basebutton" aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a role="button" id="darkbutton" class="basebutton darkwidget" aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a role="button" id="searchbutton" class="basebutton searchwidget" aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a>

  
  
  

  
  
  <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img');
    var i;
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a');
      wrapper.setAttribute('href', img[i].getAttribute('data-src'));
      wrapper.setAttribute('aria-label', 'illustration');
      wrapper.style.cssText = 'width: 100%; display: flex; justify-content: center;';
      if (img[i].alt) wrapper.dataset.caption = img[i].alt;
      wrapper.dataset.nolink = true;
      img[i].before(wrapper);
      wrapper.append(img[i]);
      var divWrap = document.createElement('div');
      divWrap.classList.add('gallery');
      wrapper.before(divWrap);
      divWrap.append(wrapper);
    }
    baguetteBox.run('.gallery');
  }
</script>
<script>loadScript("/js/lib/lightbox/baguetteBox.min.js", addImgLayout)</script>
  
  
  
<script src="/js/main.js"></script>

  
  <script>loadScript("/js/lib/busuanzi.min.js")</script>
  
  
  <script>
    var addLazyload = function () {
      var observer = lozad('.lozad', {
        load: function (el) {
          el.srcset = el.getAttribute('data-src');
        },
        loaded: function (el) {
          el.classList.add('loaded');
        }
      });
      observer.observe();
    }
  </script>
  <script>loadScript("/js/lib/lozad.min.js", addLazyload)</script>
  
  
</body>

</html>